(function () {
    /*
    *Author Kwan
    *Date 2010-12-24
    *Function Message class must import jquery.form.js
    */

    //check the class name , it will be replaced when existed
    if (window.Message) {
        alert('variable Message has been used,it will be replaced with _Message');
        window._Message = window.Message;
    }

    //constructor
    window.Message = function (param) {
        param = param instanceof Object ? param : {};
        this.cfg = param.cfg || {};
    }

    var pt = Message.prototype;

    pt.fileName = '';

    pt.showmsg = function (obj) {
        //alert(obj.id); return false;
        $.ajax({ url: "facade.axd", cache: true, dataType: "json", data: decodeURI("action=Applican&s_method=list&query=id=" + obj.id),
            beforeSend: function (x) { x.setRequestHeader("Content-Type", "application/json; charset=utf-8"); },
            complete: function (x, s) {
                var json = eval('(' + x.responseText + ')');
                //alert($('#MSGcontent_' + obj.id).html());
                $('#msg_' + obj.id).show();
                $('#MSGcontent_' + obj.id).html('面试时间：' + json.data[0].ViewDate + ' ' + json.data[0].ViewTime + '<br>    ' + json.data[0].Memo + '<br>' + json.data[0].CompanyName);
            }
        });
    }
    pt.Hide = function (obj) {
        $('#msg_' + obj).hide();
    }
    pt.doShow = function () {
        var chkBox = $(".table6 :checkbox");
        chkBox.each(function () {
            var id = $(this).next().attr('value');
            pt.showmsg(document.getElementById(id));
            var s = $('#msg_' + $(this).val());
            s.each(function () { $(this).show(); });
        });
    }
    pt.doHide = function () {
        var app = $(".table6 :hidden");
        app.each(function () {
            var s = $('#msg_' + $(this).val());
            s.each(function () { $(this).hide(); });
        });
    }
})();

window.msg = new Message();
window._ = msg._;